package com.itheima.factory;

import com.itheima.controller.IStudentController;
import com.itheima.controller.ITeacherController;
import com.itheima.controller.impl.TeacherControllerImpl;
import com.itheima.dao.IStudentDao;
import com.itheima.dao.ITeacherDao;
import com.itheima.dao.impl.TeacherDaoImpl;
import com.itheima.service.IStudentService;
import com.itheima.service.ITeacherService;
import com.itheima.service.impl.TeacherServiceImpl;

/*
工厂类
提供生产对象的方法
 */
public class Factory {

    //生产 学生Controller
    public static IStudentController getStudentController(){
        return new StudentControllerImpl();
    }
    //生产 老师Controller
    public static ITeacherController getTeacherController(){return new TeacherControllerImpl(); }
    //生产 学生Service
    public static IStudentService getStuService(){
        return new StudentServiceImpl();
    }
    //生产 老师Service
    public static ITeacherService geiTeaService(){return new TeacherServiceImpl(); }
    //生产 学生Dao
    public static IStudentDao getStudentDao(){
        return new StudentDaoImpl();
    }
    //生产 老师Dao
    public static ITeacherDao getTeacherDao(){ return new TeacherDaoImpl(); }
}
